home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / wincap.zip / DIBUTIL.H < prev    next >
C/C++ Source or Header  |  1991-11-05  |  1KB  |  41 lines

  1. /*
  2.  *  dibutil.h
  3.  *
  4.  *  Copyright (c) 1991 Microsoft Corporation. All rights reserved.
  5.  *
  6.  *  Header file for Device-Independent Bitmap (DIB) API.  Provides
  7.  *  function prototypes and constants for the following functions:
  8.  *
  9.  *  FindDIBBits()        - Sets pointer to the DIB bits
  10.  *  DIBWidth()            - Gets the DIB width
  11.  *  DIBHeight()            - Gets the DIB height
  12.  *  DIBNumColors()        - Calculates number of colors in the DIB's color table
  13.  *  PaletteSize()        - Calculates the buffer size required by a palette
  14.  *  CreateDIBPalette()    - Creates a palette from a DIB
  15.  *  DIBToBitmap()        - Creates a bitmap from a DIB
  16.  *  BitmapToDIB()        - Creates a DIB from a bitmap
  17.  *  PalEntriesOnDevice()- Gets the number of palette entries
  18.  *  GetSystemPalette()    - Gets the current palette
  19.  *
  20.  */
  21. #include "dibapi.h"
  22.  
  23. /* DIB constants */
  24. #define PALVERSION   0x300
  25.  
  26. /* DIB macros */
  27. #define WIDTHBYTES(bits)    (((bits) + 31) / 32 * 4)
  28. #define IS_WIN30_DIB(lpbi)  ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
  29.  
  30. /* function prototypes */
  31. LPSTR        FindDIBBits(LPSTR lpbi);
  32. DWORD        DIBWidth(LPSTR lpDIB);
  33. DWORD        DIBHeight(LPSTR lpDIB);
  34. WORD         DIBNumColors(LPSTR lpbi);
  35. WORD         PaletteSize(LPSTR lpbi);
  36. HPALETTE     CreateDIBPalette(HDIB hDIB);
  37. HBITMAP      DIBToBitmap(HDIB hDIB, HPALETTE hPal);
  38. HDIB         BitmapToDIB(HBITMAP hBitmap, HPALETTE hPal);
  39. int            PalEntriesOnDevice(HDC hDC);
  40. HPALETTE     GetSystemPalette(void);
  41.